import axios from '@/api/fetch';
import SERVER from '@/api/server';

export const queryAllPartObligated = params => axios.get(`${SERVER.DMSCLOUD_PART}/bookpart/searchAll`, { params });

export const queryPartObligatedItem = params => axios.get(`${SERVER.DMSCLOUD_PART}/bookpart/item`, { params });

export const performExecute = params => axios.put(`${SERVER.DMSCLOUD_PART}/bookpart/release`, params);

export const performExecutes = params => axios.put(`${SERVER.DMSCLOUD_PART}/bookpart/hold`, params);

export const queryStockInfo = params => axios.get(`${SERVER.DMSCLOUD_PART}/bookpart/part`, { params });

export const queryPartInfo = params => axios.get(`${SERVER.DMSCLOUD_PART}/bookpart/parts`, { params });

export const querys = id => axios.get(`${SERVER.DMSCLOUD_PART}/bookpart/querys`, { id });
// 明细导出
export const exportData = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/bookpart/export`, {
    params,
    responseType: 'blob'
  });
